-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Use address reserved for docs in comment #146294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Addresses starting with "192.0.2.", "198.51.100.", or "203.0.113." are reserved for use in documentation and sample configurations. The original was some random french IP
|
https://doc.rust-lang.org/nightly/std/net/struct.Ipv4Addr.html#method.is_global documents such addresses as not being global, so I expect the doc test to fail. |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
According to https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml, these special addresses are global: |
|
seems like this is an awkward method to write good docs for in that case... |
|
IPs have a one-hot classification, being a documentation IP means it isn't global https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=4d02d0c8fe5827b36b87a3b9dbbc0605. Based on the comment from @hkBst this also seems like a correct classification for the two IPs in question here.
What makes the docs incorrect or bad? @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
Not incorrect, that is definitely a global IP in the original. My intention with this pull request was to use a global IP reserved for documentation so that some random IP address wasn't being used. I should have done more research before opening this, please forgive me for wasting time. I am still learning Rust, so while I was reading the docs, I was under the impression that the global IP currently in the docs was a special global IP address that had a certain use case, but when I looked it up, it seems to be an arbitrarily chosen IP for demonstration. I was thinking that using a global IP address that is more general or perhaps reserved for examples would make the documentation for the is_global() method more clear. |
|
Well, it is probably randomly chosen :) They don't really say but I assume IETF5737 is probably meant for documentation where you might actually interact with the IP addresses (like pinging/connecting), and not so much for documenting effectively "this is what x kind of IP could look like". That would make it a bit tough to write IETF docs about anything other than documentation IPs.
There is no waste and it's not a problem! New ideas are always welcome, and everybody learns in situations like this. I am going to close this though, since I don't think it is actionable. |
To address this a bit more directly; most of the IPs in this section of the docs are arbitrary and for demonstration. There are a range of values that match the |
Addresses starting with "192.0.2.", "198.51.100.", or "203.0.113." are reserved for use in documentation and sample configurations. The original was some random french IP, just changed it to an address reserved for documentation by the Internet Assigned Numbers Authority